import 'package:flutter/material.dart';

class ColorsUtil {
  //主题色
  static const theme = Color(0xff27AD63);
  //页面背景颜色
  static const bg = Color(0xfff0f2f5);
// 标题颜色
  static const title = Color(0xff333333);

  static const subTitle = Color(0xff666666);
  static const content = Color(0xff999999);

  static const textBg = Color(0xfff5f5f5);

  static const separator = Color(0xffeeeeee);

  static const placeholder = Color(0xffbbbbbb);

  static const white = Color(0xffffffff);
  static const orange = Color(0xfff65436);
  static const gold = Color(0xffd2a356);
  static const purple = Color(0xffa256d2);
  static const green = Color(0xff27ad63);
  static const blue = Color(0xff43a8e8);
  static const red = Color(0xfff24e4e);
  static const blueDeep = Color(0xff576C88);

  /// 十六进制颜色，
  /// hex, 十六进制值，例如：0xffffff,
  /// alpha, 透明度 [0.0,1.0]
  static Color hex(int hex, {double alpha = 1}) {
    if (alpha < 0) {
      alpha = 0;
    } else if (alpha > 1) {
      alpha = 1;
    }
    return Color.fromRGBO((hex & 0xFF0000) >> 16, (hex & 0x00FF00) >> 8,
        (hex & 0x0000FF) >> 0, alpha);
  }
}
/*
00%=FF（不透明） 
5%=F2 
10%=E5 
15%=D8 
20%=CC 
25%=BF 
30%=B2 
35%=A5 
40%=99 
45%=8c 
50%=7F 
55%=72 
60%=66 
65%=59 
70%=4c 
75%=3F 
80%=33 
85%=21 
90%=19 
95%=0c 
100%=00（全透明）
 */
